{% extends 'base.html' %}
{% block title %}
 流逝的时间
{% endblock %}

{% block body %}
<form action="{{ url_for('stime') }}" method="post" class="layui-form" style="padding-top: 15px">
<div class="layui-form-item ">
    <div class="layui-inline">
           <input type="text" class="layui-input" id="s_time" name="s_time" placeholder="开始时间">
    </div>
    <div class="layui-inline">
           <input type="text" class="layui-input" id="e_time" name="e_time" placeholder="结束时间">
    </div>
</div>
 <div class="layui-form-item layui-form-text">
      <textarea name="content" width="100%" placeholder="完成内容" class="layui-textarea"></textarea>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-block" style="text-align: right">
      <button class="layui-btn" type="submit">添加时间内容</button>
    </div>
  </div>
</form>

{% for stime in stime.items %}
      <div class="layui-card layui-bg-orange">
        <div class="layui-card-header" style="text-align: left;">{{ stime.s_time  }}到{{ stime.e_time }}</div>
        <div class="layui-card-body">
          {{ stime.content }}
        </div>
      </div>
{% endfor %}


<div id="test1"></div>
{% endblock %}

{% block js %}
<script>
layui.use(['form','laypage','jquery','laydate'],function () {
    var form = layui.form,
        $ = layui.$,
        laydate = layui.laydate,
        laypage = layui.laypage;

laydate.render({
    elem: '#s_time'
    ,type: 'datetime'
  });
laydate.render({
    elem: '#e_time'
    ,type: 'datetime'
  });
laypage.render({
  elem: 'test1'
  ,count: {{ counts }}
  ,curr:{{ page }}
  ,jump: function(obj, first){

    //首次不执行
    if(!first){
       location.href="{{ url_for('stime') }}?page="+obj.curr+"&limit="+obj.limit;

    }
  }
});
    });
</script>
{% endblock %}